﻿using System;

namespace IupNET
{
    public class HBox:Control
    {
        public HBox(params Control[] children)
            : base(Iupc.Hboxv(Convert.ControlArrayToPtrArray(children)))
        {

        }

        public Alignment Alignment
        {
            get
            {
                return Convert.StringToAlign(GetAttribute("ALIGNMENT"));
            }
            set
            {
                SetAttribute("ALIGNMENT", Convert.AlignToString(value));
            }
        }

        /*public bool ExpandChildren
        {
            get
            {
                return GetAttribute("EXPANDCHILDREN") == "YES";
            }
            set
            {
                SetAttribute("EXPANDCHILDREN", value ? "YES" : "NO");
            }
        }*/

        public Expand ExpandChildren
        {
            get
            {
                return Convert.StringToExpand(GetAttribute("EXPANDCHILDREN"));
            }
            set
            {
                SetAttribute("EXPANDCHILDREN", Convert.ExpandToString(value));
            }
        }

        public int Gap
        {
            get
            {
                return Convert.StringToInt(GetAttribute("GAP"));
            }
            set
            {
                SetAttribute("GAP", value.ToString());
            }
        }

        public int CGap
        {
            get
            {
                return Convert.StringToInt(GetAttribute("CGAP"));
            }
            set
            {
                SetAttribute("CGAP", value.ToString());
            }
        }

        public bool Homogeneous
        {
            get
            {
                return GetAttribute("HOMOGENEOUS") == "YES";
            }
            set
            {
                SetAttribute("HOMOGENEOUS", value ? "YES" : "NO");
            }
        }

        public Size2i Margin
        {
            get
            {
                return Convert.StringToSize(GetAttribute("MARGIN"));
            }
            set
            {
                SetAttribute("MARGIN", Convert.SizeToString(value));
            }
        }


        public Size2i CMargin
        {
            get
            {
                return Convert.StringToSize(GetAttribute("CMARGIN"));
            }
            set
            {
                SetAttribute("CMARGIN", Convert.SizeToString(value));
            }
        }

        public NormalizeSize NormalizeSize
        {
            get
            {
                return Convert.StringToNormSize(GetAttribute("NORMALIZESIZE"));
            }
            set
            {
                SetAttribute("NORMALIZESIZE", Convert.NormSizeToString(value));
            }
        }
        
    }
}
